# from django.contrib.auth.models import User
# from django.contrib.sessions.models import Session
# from rest_framework import exceptions
# from rest_framework.permissions import BasePermission
#
#
# class MyPermission(BasePermission):
#     """
#     A base class from which all permission classes should inherit.
#     """
#     #
#     # def has_permission(self, request, view):
#     #     session_id = request.GET.get('session_id')
#     #     if session_id:
#     #         session = Session.objects.get(session_key=session_id)
#     #         if not session:
#     #             return False
#     #         uid = session.get_decoded().get('_auth_user_id')
#     #         user1 = User.objects.get(pk=uid)
#     #         return  True
#     # def has_object_permission(self, request, view, obj):
#     #     """
#     #     Return `True` if permission is granted, `False` otherwise.
#     #     """
#     #     return True
